package coml.jiyun.hp.wanandroid.model;

import coml.jiyun.hp.wanandroid.base.BaseModel;
import coml.jiyun.hp.wanandroid.bean.SystemBean;
import coml.jiyun.hp.wanandroid.net.HttpUtil;
import coml.jiyun.hp.wanandroid.net.ResultCallBack;
import coml.jiyun.hp.wanandroid.net.ResultSubscriber;
import coml.jiyun.hp.wanandroid.net.RxUtils;

public class SystemModel extends BaseModel {
    public void getSystem(final ResultCallBack<SystemBean> callBack){
        addDisposable(HttpUtil
            .getInstance()
            .getSystemServer()
            .getSystem()
            .compose(RxUtils.<SystemBean>rxSchedulerHelper())
            .subscribeWith(new ResultSubscriber<SystemBean>() {
                @Override
                public void onNext(SystemBean systemBean) {
                    callBack.onSuccess(systemBean);
                }
            }));
    }
}